namespace YMJake.Flowable.ExternalWorker.Client.Core.Client;

/// <summary>
/// Builder interface for creating work results
/// Similar to Java's WorkerResultBuilder
/// </summary>
public interface IWorkResultBuilder
{
    /// <summary>
    /// Create a new WorkerResult.Success that can be used as a return type
    /// for worker handlers
    /// </summary>
    WorkerResult.Success Success();

    /// <summary>
    /// Create a new WorkerResult.BpmnError that can be used as a return type
    /// for worker handlers.
    /// This result will lead to a BPMN Error completion of the external worker.
    /// </summary>
    WorkerResult.BpmnError BpmnError();

    /// <summary>
    /// Create a new WorkerResult.BpmnError that can be used as a return type
    /// for worker handlers.
    /// This result will lead to a BPMN Error completion of the external worker.
    /// </summary>
    /// <param name="errorCode">the error code for the BPMN error</param>
    WorkerResult.BpmnError BpmnError(string errorCode);

    /// <summary>
    /// Create a new WorkerResult.CmmnTermination that can be used as a return type
    /// for worker handlers
    /// This result will lead to a CMMN termination of the external worker.
    /// </summary>
    WorkerResult.CmmnTermination CmmnTerminate();

    /// <summary>
    /// Create a new WorkerResult.Failure that can be used as a return type
    /// for worker handlers
    /// </summary>
    WorkerResult.Failure Failure();
}